#pragma once
#include <QWidget>
#include <QPainterPath>
#include "swidgets.h"

class S_WIDGETS_EXPORT SwitchButton : public QWidget
{
	Q_OBJECT
	Q_PROPERTY(bool switchOn MEMBER m_switchOn NOTIFY switchChanged)
public:
	SwitchButton(bool on = true, QWidget* parent = nullptr);
	QSize sizeHint() const;

	float	m_scaleFactor;

protected:
	void paintEvent(QPaintEvent* event) override;
	void mouseReleaseEvent(QMouseEvent* event) override;

signals:
	void switchChanged(bool);

private:
	void initButton();
private:
	bool	m_switchOn;
};
